Skip to content

ci: Dependabot's patch and minor updates merge by themselves once the checks pass - #35

Merged
silveltman merged 2 commits into
mainfrom
ci/dependabot-auto-merge
Nov 23, 2026
Merged

silveltman merged 2 commits into
mainfrom
ci/dependabot-auto-merge

Conversation

@silveltman

@silveltman silveltman commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Sil wants green Dependabot PRs to merge by themselves, so security updates stop piling up across the websites. Today they wait for a person, even when every check passed.

This adds a Dependabot action that each website, astro-template and vite-template call from a small pull_request_target workflow (the caller is in the README). Each run first turns off auto-merge from an earlier run. It then turns GitHub's squash auto-merge back on, so GitHub merges once the required checks pass, only when:

  • the default branch requires Check / Check and Review. Without them, auto-merge would merge at once, even when red;
  • it is an npm PR whose updates are all patch steps, or minor steps from 1.0 up. Security updates carry no update-type in their metadata, so the versions in the commit decide, scoped names included. Majors, minors below 1.0 and pre-releases stay for a person, because checks do not catch visual changes;
  • every commit is Dependabot's and signed by GitHub, and nothing under .github/ changes.

It merges at once only when GitHub refuses auto-merge because the PR can already merge, tied to the head SHA.

The organization's GitHub App token turns it on, so the merge starts the workflows on main (Check and the live tests); a GITHUB_TOKEN merge would not. pull_request_target runs the default branch's file with the repository's secrets and the action never checks out the PR. Each repository needs:

  • Allow auto-merge;
  • the app installed;
  • the RELEASE_APP_CLIENT_ID variable and the RELEASE_APP_PRIVATE_KEY secret, which the organization now shares with only a few repositories.

Without them the job fails and nothing merges.

An independent review found that quoted scoped names counted as major, that only a successful later run turned auto-merge off, and that the commit author alone can be set by anyone. All three are fixed, with a real Dependabot commit as a test fixture. node --test tests/*.test.mjs passes, 30 tests, 7 of them for this action.

Created with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

silveltman and others added 2 commits November 23, 2026 22:19
… checks pass

A Dependabot action for each repository's pull_request_target workflow turns
on GitHub's squash auto-merge with the organization's app token, only where
the default branch requires Check / Check and Review, for npm PRs of patch and
minor updates from 1.0 up with only Dependabot's commits and no .github
change. It turns auto-merge off again when a PR stops qualifying.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…commits

Dependabot quotes scoped names in its metadata, so "@hono/node-server" never
matched its version line and most security PRs counted as major. Each run now
turns earlier auto-merge off first and back on only while the head qualifies,
and only Dependabot's commits signed by GitHub count. A real security-group
commit is a test fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silveltman
silveltman merged commit 9de7f82 into main Nov 23, 2026
3 checks passed
@silveltman
silveltman deleted the ci/dependabot-auto-merge branch November 23, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant